import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Login from '../views/user/login/index.vue';
import DefaultLayout from "@/layout/DefaultLayout.vue";
import Welcome from "@/views/welcome/index.vue";
import User from "@/views/system/user/index.vue";
import Menu from "@/views/system/menu/index.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path: "/back",
    redirect: "/back/welcome",
    component: DefaultLayout,
    children: [
      {
        path: "/back/welcome",
        name: "backWelcome",
        component: Welcome,
      },
      {
        path: "/system/user",
        name: "user",
        component: User,
      },
      {
        path: "/system/menu",
        name: "menu",
        component: Menu,
      },
    ],
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
